<template>
    <div class="bg">
        <dv-loading v-if="isLoading">Loading...</dv-loading>
        <div class="main-container flex-column" v-else>
            <div class="header fixed-header">
                <div class="header-content">
                    <div class="title-row">
                        <dv-decoration-10 class="dtl"></dv-decoration-10>
                        <dv-decoration8 class="dtc"></dv-decoration8>
                        <div class="title">天津市智慧水务网络检测平台</div>
                        <dv-decoration8 class="dtc" :reverse="true"></dv-decoration8>
                        <dv-decoration-10 class="dtl re" :reverse="true"></dv-decoration-10>
                        <div class="time">
                            <CurrentTime class="fs-sm" />
                        </div>
                        <div class="weather">
                            <WeatherPanel class="fs-sm w-100" />
                        </div>
                    </div>

                </div>
            </div>
            <div class="center w-100 flex-1">
                <router-view />
            </div>
            <div class="nav-row">
                <NavBar></NavBar>
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import NavBar from '@/components/NavBar.vue';
import CurrentTime from '@/components/CurrentTime.vue';
import WeatherPanel from '@/components/WeatherPanel.vue'

let isLoading = ref(false)
</script>

<style lang="scss" scoped>
.bg {
    background-color: #00060b;
    height: 100vh;
    width: 100%;

    .main-container {
        display: flex;
        height: 100%;
        width: 100%;
        position: relative;

        .header {
            width: 100%;

            .header-content {
                width: 100%;
                max-width: 1920px;
                margin: 0 auto;
                padding: 0 20px;
                box-sizing: border-box;
                background-color: #00060b;
            }

            .title-row {
                height: 5vh;
                flex: 0;
                padding: 10px 0 10px 0;
                display: flex;
                flex-direction: row;
                align-items: start;
                justify-content: center;
                position: relative;

                >* {
                    flex: 1;
                }

                .dtc {
                    height: 100%;
                }

                .dtl {
                    height: 1px;
                    flex: 2
                }

                .re {
                    transform: rotateY(180deg);
                }

                .title {
                    flex: 1 0 0;
                    white-space: nowrap;
                    color: #00c2ff;
                    margin: 0 10px;
                    font-size: 25px;
                    text-align: center;
                }

                .time {
                    position: absolute;
                    right: 1%;
                    top: 20px;
                    white-space: nowrap;
                    text-align: right;
                }

                .weather {
                    position: absolute;
                    left: 1%;
                    top: 40px;
                    white-space: nowrap;
                    text-align: right;
                    width: 200px;
                }
            }
        }

        .nav-row {
            position: fixed;
            bottom: 0;
            width: 45vw;
            left: 50%;
            transform: translate(-50%, 0);
            z-index: 100;
        }
    }
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #00060b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.center {
    margin-top: 7vh;
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    box-sizing: border-box;
}
</style>